using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;

namespace ConsoleApplication2.Models.Mapping
{
    public class SO_patLgDentMap : EntityTypeConfiguration<SO_patLgDent>
    {
        public SO_patLgDentMap()
        {
            // Primary Key
            this.HasKey(t => new { t.Iid, t.Mobile });

            // Properties
            this.Property(t => t.ID)
                .HasMaxLength(6);

            this.Property(t => t.Iid)
                .HasDatabaseGeneratedOption(DatabaseGeneratedOption.None);

            this.Property(t => t.SALUTATION)
                .HasMaxLength(10);

            this.Property(t => t.CASE__)
                .HasMaxLength(15);

            this.Property(t => t.Latin_Name)
                .HasMaxLength(30);

            this.Property(t => t.Arabic_Name)
                .HasMaxLength(40);

            this.Property(t => t.LAST_NAME)
                .HasMaxLength(50);

            this.Property(t => t.ARABIC_LAST_NAME)
                .HasMaxLength(50);

            this.Property(t => t.Phones)
                .HasMaxLength(30);

            this.Property(t => t.Mobile)
                .IsRequired()
                .HasMaxLength(19);

            this.Property(t => t.ADDRESS)
                .HasMaxLength(80);

            this.Property(t => t.FIRST_NAME)
                .HasMaxLength(50);

            this.Property(t => t.FATHER_NAME)
                .HasMaxLength(50);

            this.Property(t => t.MOTHER_NAME)
                .HasMaxLength(50);

            this.Property(t => t.ARABIC_SALUTATION)
                .HasMaxLength(10);

            this.Property(t => t.ARABIC_FIRST_NAME)
                .HasMaxLength(50);

            this.Property(t => t.ARABIC_FATHER_NAME)
                .HasMaxLength(50);

            this.Property(t => t.ARABIC_MOTHER_NAME)
                .HasMaxLength(50);

            this.Property(t => t.CITY)
                .HasMaxLength(30);

            this.Property(t => t.NATIONALITY)
                .HasMaxLength(20);

            this.Property(t => t.PAGER)
                .HasMaxLength(12);

            this.Property(t => t.id_type)
                .HasMaxLength(20);

            this.Property(t => t.Identification__)
                .HasMaxLength(20);

            this.Property(t => t.GENDER)
                .HasMaxLength(7);

            this.Property(t => t.MARITAL_STATUS)
                .HasMaxLength(8);

            this.Property(t => t.SPOUSE_NAME)
                .HasMaxLength(30);

            this.Property(t => t.PHYSICIAN_NAME)
                .HasMaxLength(50);

            this.Property(t => t.PATIENT_STATUS)
                .HasMaxLength(11);

            this.Property(t => t.STATE)
                .HasMaxLength(3);

            this.Property(t => t.ACCCOUNT__)
                .HasMaxLength(20);

            this.Property(t => t.CURRENCY)
                .HasMaxLength(5);

            this.Property(t => t.OCCUPATION)
                .HasMaxLength(20);

            this.Property(t => t.EMPLOYER)
                .HasMaxLength(20);

            this.Property(t => t.MISSALINSCODE)
                .HasMaxLength(24);

            this.Property(t => t.ACTIVE)
                .HasMaxLength(5);

            this.Property(t => t.E_MAIL)
                .HasMaxLength(50);

            // Table & Column Mappings
            this.ToTable("SO_patLgDent");
            this.Property(t => t.ID).HasColumnName("ID");
            this.Property(t => t.Iid).HasColumnName("Iid");
            this.Property(t => t.SALUTATION).HasColumnName("SALUTATION");
            this.Property(t => t.CASE__).HasColumnName("CASE_#");
            this.Property(t => t.Latin_Name).HasColumnName("Latin_Name");
            this.Property(t => t.Arabic_Name).HasColumnName("Arabic_Name");
            this.Property(t => t.LAST_NAME).HasColumnName("LAST_NAME");
            this.Property(t => t.ARABIC_LAST_NAME).HasColumnName("ARABIC_LAST_NAME");
            this.Property(t => t.Phones).HasColumnName("Phones");
            this.Property(t => t.Mobile).HasColumnName("Mobile");
            this.Property(t => t.ADDRESS).HasColumnName("ADDRESS");
            this.Property(t => t.FIRST_NAME).HasColumnName("FIRST_NAME");
            this.Property(t => t.FATHER_NAME).HasColumnName("FATHER_NAME");
            this.Property(t => t.MOTHER_NAME).HasColumnName("MOTHER_NAME");
            this.Property(t => t.ARABIC_SALUTATION).HasColumnName("ARABIC_SALUTATION");
            this.Property(t => t.ARABIC_FIRST_NAME).HasColumnName("ARABIC_FIRST_NAME");
            this.Property(t => t.ARABIC_FATHER_NAME).HasColumnName("ARABIC_FATHER_NAME");
            this.Property(t => t.ARABIC_MOTHER_NAME).HasColumnName("ARABIC_MOTHER_NAME");
            this.Property(t => t.CITY).HasColumnName("CITY");
            this.Property(t => t.NATIONALITY).HasColumnName("NATIONALITY");
            this.Property(t => t.PAGER).HasColumnName("PAGER");
            this.Property(t => t.id_type).HasColumnName("id_type");
            this.Property(t => t.Identification__).HasColumnName("Identification_#");
            this.Property(t => t.BIRTH_DATE).HasColumnName("BIRTH_DATE");
            this.Property(t => t.GENDER).HasColumnName("GENDER");
            this.Property(t => t.MARITAL_STATUS).HasColumnName("MARITAL_STATUS");
            this.Property(t => t.SPOUSE_NAME).HasColumnName("SPOUSE_NAME");
            this.Property(t => t.PHYSICIAN_NAME).HasColumnName("PHYSICIAN_NAME");
            this.Property(t => t.PATIENT_STATUS).HasColumnName("PATIENT_STATUS");
            this.Property(t => t.DATE_ADDED).HasColumnName("DATE_ADDED");
            this.Property(t => t.STATE).HasColumnName("STATE");
            this.Property(t => t.ACCCOUNT__).HasColumnName("ACCCOUNT_#");
            this.Property(t => t.CURRENCY).HasColumnName("CURRENCY");
            this.Property(t => t.PAYMENT_TERMS).HasColumnName("PAYMENT_TERMS");
            this.Property(t => t.OCCUPATION).HasColumnName("OCCUPATION");
            this.Property(t => t.EMPLOYER).HasColumnName("EMPLOYER");
            this.Property(t => t.MISSALINSCODE).HasColumnName("MISSALINSCODE");
            this.Property(t => t.ACTIVE).HasColumnName("ACTIVE");
            this.Property(t => t.E_MAIL).HasColumnName("E-MAIL");
        }
    }
}
